// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.


suite("test_cast_to_float_from_datev2") {

    // This test case is generated from the correspoinding be UT test case,
    // update this case if the correspoinding be UT test case is updated,
    // e.g.: ../run-be-ut.sh --run --filter=FunctionCastToDecimalTest.* --gen_regression_case
    sql "drop table if exists test_cast_to_float_from_datev2_0_nullable;"
    sql "create table test_cast_to_float_from_datev2_0_nullable(f1 int, f2 datev2) properties('replication_num'='1');"
    sql """insert into test_cast_to_float_from_datev2_0_nullable values (0, "0000-01-01"),(1, "0000-01-02"),(2, "0000-01-09"),(3, "0000-01-10"),(4, "0000-01-11"),(5, "0000-01-28"),(6, "0000-09-01"),(7, "0000-09-02"),(8, "0000-09-09"),(9, "0000-09-10"),(10, "0000-09-11"),(11, "0000-09-28"),(12, "0000-10-01"),(13, "0000-10-02"),(14, "0000-10-09"),(15, "0000-10-10"),(16, "0000-10-11"),(17, "0000-10-28"),(18, "0000-11-01"),(19, "0000-11-02"),
      (20, "0000-11-09"),(21, "0000-11-10"),(22, "0000-11-11"),(23, "0000-11-28"),(24, "0000-12-01"),(25, "0000-12-02"),(26, "0000-12-09"),(27, "0000-12-10"),(28, "0000-12-11"),(29, "0000-12-28"),(30, "0001-01-01"),(31, "0001-01-02"),(32, "0001-01-09"),(33, "0001-01-10"),(34, "0001-01-11"),(35, "0001-01-28"),(36, "0001-09-01"),(37, "0001-09-02"),(38, "0001-09-09"),(39, "0001-09-10"),
      (40, "0001-09-11"),(41, "0001-09-28"),(42, "0001-10-01"),(43, "0001-10-02"),(44, "0001-10-09"),(45, "0001-10-10"),(46, "0001-10-11"),(47, "0001-10-28"),(48, "0001-11-01"),(49, "0001-11-02"),(50, "0001-11-09"),(51, "0001-11-10"),(52, "0001-11-11"),(53, "0001-11-28"),(54, "0001-12-01"),(55, "0001-12-02"),(56, "0001-12-09"),(57, "0001-12-10"),(58, "0001-12-11"),(59, "0001-12-28"),
      (60, "0009-01-01"),(61, "0009-01-02"),(62, "0009-01-09"),(63, "0009-01-10"),(64, "0009-01-11"),(65, "0009-01-28"),(66, "0009-09-01"),(67, "0009-09-02"),(68, "0009-09-09"),(69, "0009-09-10"),(70, "0009-09-11"),(71, "0009-09-28"),(72, "0009-10-01"),(73, "0009-10-02"),(74, "0009-10-09"),(75, "0009-10-10"),(76, "0009-10-11"),(77, "0009-10-28"),(78, "0009-11-01"),(79, "0009-11-02"),
      (80, "0009-11-09"),(81, "0009-11-10"),(82, "0009-11-11"),(83, "0009-11-28"),(84, "0009-12-01"),(85, "0009-12-02"),(86, "0009-12-09"),(87, "0009-12-10"),(88, "0009-12-11"),(89, "0009-12-28"),(90, "0010-01-01"),(91, "0010-01-02"),(92, "0010-01-09"),(93, "0010-01-10"),(94, "0010-01-11"),(95, "0010-01-28"),(96, "0010-09-01"),(97, "0010-09-02"),(98, "0010-09-09"),(99, "0010-09-10"),
      (100, "0010-09-11"),(101, "0010-09-28"),(102, "0010-10-01"),(103, "0010-10-02"),(104, "0010-10-09"),(105, "0010-10-10"),(106, "0010-10-11"),(107, "0010-10-28"),(108, "0010-11-01"),(109, "0010-11-02"),(110, "0010-11-09"),(111, "0010-11-10"),(112, "0010-11-11"),(113, "0010-11-28"),(114, "0010-12-01"),(115, "0010-12-02"),(116, "0010-12-09"),(117, "0010-12-10"),(118, "0010-12-11"),(119, "0010-12-28"),
      (120, "0011-01-01"),(121, "0011-01-02"),(122, "0011-01-09"),(123, "0011-01-10"),(124, "0011-01-11"),(125, "0011-01-28"),(126, "0011-09-01"),(127, "0011-09-02"),(128, "0011-09-09"),(129, "0011-09-10"),(130, "0011-09-11"),(131, "0011-09-28"),(132, "0011-10-01"),(133, "0011-10-02"),(134, "0011-10-09"),(135, "0011-10-10"),(136, "0011-10-11"),(137, "0011-10-28"),(138, "0011-11-01"),(139, "0011-11-02"),
      (140, "0011-11-09"),(141, "0011-11-10"),(142, "0011-11-11"),(143, "0011-11-28"),(144, "0011-12-01"),(145, "0011-12-02"),(146, "0011-12-09"),(147, "0011-12-10"),(148, "0011-12-11"),(149, "0011-12-28"),(150, "0099-01-01"),(151, "0099-01-02"),(152, "0099-01-09"),(153, "0099-01-10"),(154, "0099-01-11"),(155, "0099-01-28"),(156, "0099-09-01"),(157, "0099-09-02"),(158, "0099-09-09"),(159, "0099-09-10"),
      (160, "0099-09-11"),(161, "0099-09-28"),(162, "0099-10-01"),(163, "0099-10-02"),(164, "0099-10-09"),(165, "0099-10-10"),(166, "0099-10-11"),(167, "0099-10-28"),(168, "0099-11-01"),(169, "0099-11-02"),(170, "0099-11-09"),(171, "0099-11-10"),(172, "0099-11-11"),(173, "0099-11-28"),(174, "0099-12-01"),(175, "0099-12-02"),(176, "0099-12-09"),(177, "0099-12-10"),(178, "0099-12-11"),(179, "0099-12-28"),
      (180, "0100-01-01"),(181, "0100-01-02"),(182, "0100-01-09"),(183, "0100-01-10"),(184, "0100-01-11"),(185, "0100-01-28"),(186, "0100-09-01"),(187, "0100-09-02"),(188, "0100-09-09"),(189, "0100-09-10"),(190, "0100-09-11"),(191, "0100-09-28"),(192, "0100-10-01"),(193, "0100-10-02"),(194, "0100-10-09"),(195, "0100-10-10"),(196, "0100-10-11"),(197, "0100-10-28"),(198, "0100-11-01"),(199, "0100-11-02"),
      (200, "0100-11-09"),(201, "0100-11-10"),(202, "0100-11-11"),(203, "0100-11-28"),(204, "0100-12-01"),(205, "0100-12-02"),(206, "0100-12-09"),(207, "0100-12-10"),(208, "0100-12-11"),(209, "0100-12-28"),(210, "0101-01-01"),(211, "0101-01-02"),(212, "0101-01-09"),(213, "0101-01-10"),(214, "0101-01-11"),(215, "0101-01-28"),(216, "0101-09-01"),(217, "0101-09-02"),(218, "0101-09-09"),(219, "0101-09-10"),
      (220, "0101-09-11"),(221, "0101-09-28"),(222, "0101-10-01"),(223, "0101-10-02"),(224, "0101-10-09"),(225, "0101-10-10"),(226, "0101-10-11"),(227, "0101-10-28"),(228, "0101-11-01"),(229, "0101-11-02"),(230, "0101-11-09"),(231, "0101-11-10"),(232, "0101-11-11"),(233, "0101-11-28"),(234, "0101-12-01"),(235, "0101-12-02"),(236, "0101-12-09"),(237, "0101-12-10"),(238, "0101-12-11"),(239, "0101-12-28"),
      (240, "0999-01-01"),(241, "0999-01-02"),(242, "0999-01-09"),(243, "0999-01-10"),(244, "0999-01-11"),(245, "0999-01-28"),(246, "0999-09-01"),(247, "0999-09-02"),(248, "0999-09-09"),(249, "0999-09-10"),(250, "0999-09-11"),(251, "0999-09-28"),(252, "0999-10-01"),(253, "0999-10-02"),(254, "0999-10-09"),(255, "0999-10-10"),(256, "0999-10-11"),(257, "0999-10-28"),(258, "0999-11-01"),(259, "0999-11-02"),
      (260, "0999-11-09"),(261, "0999-11-10"),(262, "0999-11-11"),(263, "0999-11-28"),(264, "0999-12-01"),(265, "0999-12-02"),(266, "0999-12-09"),(267, "0999-12-10"),(268, "0999-12-11"),(269, "0999-12-28"),(270, "1000-01-01"),(271, "1000-01-02"),(272, "1000-01-09"),(273, "1000-01-10"),(274, "1000-01-11"),(275, "1000-01-28"),(276, "1000-09-01"),(277, "1000-09-02"),(278, "1000-09-09"),(279, "1000-09-10"),
      (280, "1000-09-11"),(281, "1000-09-28"),(282, "1000-10-01"),(283, "1000-10-02"),(284, "1000-10-09"),(285, "1000-10-10"),(286, "1000-10-11"),(287, "1000-10-28"),(288, "1000-11-01"),(289, "1000-11-02"),(290, "1000-11-09"),(291, "1000-11-10"),(292, "1000-11-11"),(293, "1000-11-28"),(294, "1000-12-01"),(295, "1000-12-02"),(296, "1000-12-09"),(297, "1000-12-10"),(298, "1000-12-11"),(299, "1000-12-28"),
      (300, "1001-01-01"),(301, "1001-01-02"),(302, "1001-01-09"),(303, "1001-01-10"),(304, "1001-01-11"),(305, "1001-01-28"),(306, "1001-09-01"),(307, "1001-09-02"),(308, "1001-09-09"),(309, "1001-09-10"),(310, "1001-09-11"),(311, "1001-09-28"),(312, "1001-10-01"),(313, "1001-10-02"),(314, "1001-10-09"),(315, "1001-10-10"),(316, "1001-10-11"),(317, "1001-10-28"),(318, "1001-11-01"),(319, "1001-11-02"),
      (320, "1001-11-09"),(321, "1001-11-10"),(322, "1001-11-11"),(323, "1001-11-28"),(324, "1001-12-01"),(325, "1001-12-02"),(326, "1001-12-09"),(327, "1001-12-10"),(328, "1001-12-11"),(329, "1001-12-28"),(330, "1999-01-01"),(331, "1999-01-02"),(332, "1999-01-09"),(333, "1999-01-10"),(334, "1999-01-11"),(335, "1999-01-28"),(336, "1999-09-01"),(337, "1999-09-02"),(338, "1999-09-09"),(339, "1999-09-10"),
      (340, "1999-09-11"),(341, "1999-09-28"),(342, "1999-10-01"),(343, "1999-10-02"),(344, "1999-10-09"),(345, "1999-10-10"),(346, "1999-10-11"),(347, "1999-10-28"),(348, "1999-11-01"),(349, "1999-11-02"),(350, "1999-11-09"),(351, "1999-11-10"),(352, "1999-11-11"),(353, "1999-11-28"),(354, "1999-12-01"),(355, "1999-12-02"),(356, "1999-12-09"),(357, "1999-12-10"),(358, "1999-12-11"),(359, "1999-12-28"),
      (360, "2000-01-01"),(361, "2000-01-02"),(362, "2000-01-09"),(363, "2000-01-10"),(364, "2000-01-11"),(365, "2000-01-28"),(366, "2000-09-01"),(367, "2000-09-02"),(368, "2000-09-09"),(369, "2000-09-10"),(370, "2000-09-11"),(371, "2000-09-28"),(372, "2000-10-01"),(373, "2000-10-02"),(374, "2000-10-09"),(375, "2000-10-10"),(376, "2000-10-11"),(377, "2000-10-28"),(378, "2000-11-01"),(379, "2000-11-02"),
      (380, "2000-11-09"),(381, "2000-11-10"),(382, "2000-11-11"),(383, "2000-11-28"),(384, "2000-12-01"),(385, "2000-12-02"),(386, "2000-12-09"),(387, "2000-12-10"),(388, "2000-12-11"),(389, "2000-12-28"),(390, "2024-01-01"),(391, "2024-01-02"),(392, "2024-01-09"),(393, "2024-01-10"),(394, "2024-01-11"),(395, "2024-01-28"),(396, "2024-09-01"),(397, "2024-09-02"),(398, "2024-09-09"),(399, "2024-09-10"),
      (400, "2024-09-11"),(401, "2024-09-28"),(402, "2024-10-01"),(403, "2024-10-02"),(404, "2024-10-09"),(405, "2024-10-10"),(406, "2024-10-11"),(407, "2024-10-28"),(408, "2024-11-01"),(409, "2024-11-02"),(410, "2024-11-09"),(411, "2024-11-10"),(412, "2024-11-11"),(413, "2024-11-28"),(414, "2024-12-01"),(415, "2024-12-02"),(416, "2024-12-09"),(417, "2024-12-10"),(418, "2024-12-11"),(419, "2024-12-28"),
      (420, "2025-01-01"),(421, "2025-01-02"),(422, "2025-01-09"),(423, "2025-01-10"),(424, "2025-01-11"),(425, "2025-01-28"),(426, "2025-09-01"),(427, "2025-09-02"),(428, "2025-09-09"),(429, "2025-09-10"),(430, "2025-09-11"),(431, "2025-09-28"),(432, "2025-10-01"),(433, "2025-10-02"),(434, "2025-10-09"),(435, "2025-10-10"),(436, "2025-10-11"),(437, "2025-10-28"),(438, "2025-11-01"),(439, "2025-11-02"),
      (440, "2025-11-09"),(441, "2025-11-10"),(442, "2025-11-11"),(443, "2025-11-28"),(444, "2025-12-01"),(445, "2025-12-02"),(446, "2025-12-09"),(447, "2025-12-10"),(448, "2025-12-11"),(449, "2025-12-28"),(450, "9999-01-01"),(451, "9999-01-02"),(452, "9999-01-09"),(453, "9999-01-10"),(454, "9999-01-11"),(455, "9999-01-28"),(456, "9999-09-01"),(457, "9999-09-02"),(458, "9999-09-09"),(459, "9999-09-10"),
      (460, "9999-09-11"),(461, "9999-09-28"),(462, "9999-10-01"),(463, "9999-10-02"),(464, "9999-10-09"),(465, "9999-10-10"),(466, "9999-10-11"),(467, "9999-10-28"),(468, "9999-11-01"),(469, "9999-11-02"),(470, "9999-11-09"),(471, "9999-11-10"),(472, "9999-11-11"),(473, "9999-11-28"),(474, "9999-12-01"),(475, "9999-12-02"),(476, "9999-12-09"),(477, "9999-12-10"),(478, "9999-12-11"),(479, "9999-12-28")
      ,(480, null);
    """

    sql "set enable_strict_cast=true;"

    test {
        sql """select f1, cast(f2 as float) from test_cast_to_float_from_datev2_0_nullable order by 1;"""
        exception ""
    }
    sql "set enable_strict_cast=false;"
    qt_sql_0_non_strict 'select f1, cast(f2 as float) from test_cast_to_float_from_datev2_0_nullable order by 1;'

    sql "drop table if exists test_cast_to_float_from_datev2_0_not_nullable;"
    sql "create table test_cast_to_float_from_datev2_0_not_nullable(f1 int, f2 datev2) properties('replication_num'='1');"
    sql """insert into test_cast_to_float_from_datev2_0_not_nullable values (0, "0000-01-01"),(1, "0000-01-02"),(2, "0000-01-09"),(3, "0000-01-10"),(4, "0000-01-11"),(5, "0000-01-28"),(6, "0000-09-01"),(7, "0000-09-02"),(8, "0000-09-09"),(9, "0000-09-10"),(10, "0000-09-11"),(11, "0000-09-28"),(12, "0000-10-01"),(13, "0000-10-02"),(14, "0000-10-09"),(15, "0000-10-10"),(16, "0000-10-11"),(17, "0000-10-28"),(18, "0000-11-01"),(19, "0000-11-02"),
      (20, "0000-11-09"),(21, "0000-11-10"),(22, "0000-11-11"),(23, "0000-11-28"),(24, "0000-12-01"),(25, "0000-12-02"),(26, "0000-12-09"),(27, "0000-12-10"),(28, "0000-12-11"),(29, "0000-12-28"),(30, "0001-01-01"),(31, "0001-01-02"),(32, "0001-01-09"),(33, "0001-01-10"),(34, "0001-01-11"),(35, "0001-01-28"),(36, "0001-09-01"),(37, "0001-09-02"),(38, "0001-09-09"),(39, "0001-09-10"),
      (40, "0001-09-11"),(41, "0001-09-28"),(42, "0001-10-01"),(43, "0001-10-02"),(44, "0001-10-09"),(45, "0001-10-10"),(46, "0001-10-11"),(47, "0001-10-28"),(48, "0001-11-01"),(49, "0001-11-02"),(50, "0001-11-09"),(51, "0001-11-10"),(52, "0001-11-11"),(53, "0001-11-28"),(54, "0001-12-01"),(55, "0001-12-02"),(56, "0001-12-09"),(57, "0001-12-10"),(58, "0001-12-11"),(59, "0001-12-28"),
      (60, "0009-01-01"),(61, "0009-01-02"),(62, "0009-01-09"),(63, "0009-01-10"),(64, "0009-01-11"),(65, "0009-01-28"),(66, "0009-09-01"),(67, "0009-09-02"),(68, "0009-09-09"),(69, "0009-09-10"),(70, "0009-09-11"),(71, "0009-09-28"),(72, "0009-10-01"),(73, "0009-10-02"),(74, "0009-10-09"),(75, "0009-10-10"),(76, "0009-10-11"),(77, "0009-10-28"),(78, "0009-11-01"),(79, "0009-11-02"),
      (80, "0009-11-09"),(81, "0009-11-10"),(82, "0009-11-11"),(83, "0009-11-28"),(84, "0009-12-01"),(85, "0009-12-02"),(86, "0009-12-09"),(87, "0009-12-10"),(88, "0009-12-11"),(89, "0009-12-28"),(90, "0010-01-01"),(91, "0010-01-02"),(92, "0010-01-09"),(93, "0010-01-10"),(94, "0010-01-11"),(95, "0010-01-28"),(96, "0010-09-01"),(97, "0010-09-02"),(98, "0010-09-09"),(99, "0010-09-10"),
      (100, "0010-09-11"),(101, "0010-09-28"),(102, "0010-10-01"),(103, "0010-10-02"),(104, "0010-10-09"),(105, "0010-10-10"),(106, "0010-10-11"),(107, "0010-10-28"),(108, "0010-11-01"),(109, "0010-11-02"),(110, "0010-11-09"),(111, "0010-11-10"),(112, "0010-11-11"),(113, "0010-11-28"),(114, "0010-12-01"),(115, "0010-12-02"),(116, "0010-12-09"),(117, "0010-12-10"),(118, "0010-12-11"),(119, "0010-12-28"),
      (120, "0011-01-01"),(121, "0011-01-02"),(122, "0011-01-09"),(123, "0011-01-10"),(124, "0011-01-11"),(125, "0011-01-28"),(126, "0011-09-01"),(127, "0011-09-02"),(128, "0011-09-09"),(129, "0011-09-10"),(130, "0011-09-11"),(131, "0011-09-28"),(132, "0011-10-01"),(133, "0011-10-02"),(134, "0011-10-09"),(135, "0011-10-10"),(136, "0011-10-11"),(137, "0011-10-28"),(138, "0011-11-01"),(139, "0011-11-02"),
      (140, "0011-11-09"),(141, "0011-11-10"),(142, "0011-11-11"),(143, "0011-11-28"),(144, "0011-12-01"),(145, "0011-12-02"),(146, "0011-12-09"),(147, "0011-12-10"),(148, "0011-12-11"),(149, "0011-12-28"),(150, "0099-01-01"),(151, "0099-01-02"),(152, "0099-01-09"),(153, "0099-01-10"),(154, "0099-01-11"),(155, "0099-01-28"),(156, "0099-09-01"),(157, "0099-09-02"),(158, "0099-09-09"),(159, "0099-09-10"),
      (160, "0099-09-11"),(161, "0099-09-28"),(162, "0099-10-01"),(163, "0099-10-02"),(164, "0099-10-09"),(165, "0099-10-10"),(166, "0099-10-11"),(167, "0099-10-28"),(168, "0099-11-01"),(169, "0099-11-02"),(170, "0099-11-09"),(171, "0099-11-10"),(172, "0099-11-11"),(173, "0099-11-28"),(174, "0099-12-01"),(175, "0099-12-02"),(176, "0099-12-09"),(177, "0099-12-10"),(178, "0099-12-11"),(179, "0099-12-28"),
      (180, "0100-01-01"),(181, "0100-01-02"),(182, "0100-01-09"),(183, "0100-01-10"),(184, "0100-01-11"),(185, "0100-01-28"),(186, "0100-09-01"),(187, "0100-09-02"),(188, "0100-09-09"),(189, "0100-09-10"),(190, "0100-09-11"),(191, "0100-09-28"),(192, "0100-10-01"),(193, "0100-10-02"),(194, "0100-10-09"),(195, "0100-10-10"),(196, "0100-10-11"),(197, "0100-10-28"),(198, "0100-11-01"),(199, "0100-11-02"),
      (200, "0100-11-09"),(201, "0100-11-10"),(202, "0100-11-11"),(203, "0100-11-28"),(204, "0100-12-01"),(205, "0100-12-02"),(206, "0100-12-09"),(207, "0100-12-10"),(208, "0100-12-11"),(209, "0100-12-28"),(210, "0101-01-01"),(211, "0101-01-02"),(212, "0101-01-09"),(213, "0101-01-10"),(214, "0101-01-11"),(215, "0101-01-28"),(216, "0101-09-01"),(217, "0101-09-02"),(218, "0101-09-09"),(219, "0101-09-10"),
      (220, "0101-09-11"),(221, "0101-09-28"),(222, "0101-10-01"),(223, "0101-10-02"),(224, "0101-10-09"),(225, "0101-10-10"),(226, "0101-10-11"),(227, "0101-10-28"),(228, "0101-11-01"),(229, "0101-11-02"),(230, "0101-11-09"),(231, "0101-11-10"),(232, "0101-11-11"),(233, "0101-11-28"),(234, "0101-12-01"),(235, "0101-12-02"),(236, "0101-12-09"),(237, "0101-12-10"),(238, "0101-12-11"),(239, "0101-12-28"),
      (240, "0999-01-01"),(241, "0999-01-02"),(242, "0999-01-09"),(243, "0999-01-10"),(244, "0999-01-11"),(245, "0999-01-28"),(246, "0999-09-01"),(247, "0999-09-02"),(248, "0999-09-09"),(249, "0999-09-10"),(250, "0999-09-11"),(251, "0999-09-28"),(252, "0999-10-01"),(253, "0999-10-02"),(254, "0999-10-09"),(255, "0999-10-10"),(256, "0999-10-11"),(257, "0999-10-28"),(258, "0999-11-01"),(259, "0999-11-02"),
      (260, "0999-11-09"),(261, "0999-11-10"),(262, "0999-11-11"),(263, "0999-11-28"),(264, "0999-12-01"),(265, "0999-12-02"),(266, "0999-12-09"),(267, "0999-12-10"),(268, "0999-12-11"),(269, "0999-12-28"),(270, "1000-01-01"),(271, "1000-01-02"),(272, "1000-01-09"),(273, "1000-01-10"),(274, "1000-01-11"),(275, "1000-01-28"),(276, "1000-09-01"),(277, "1000-09-02"),(278, "1000-09-09"),(279, "1000-09-10"),
      (280, "1000-09-11"),(281, "1000-09-28"),(282, "1000-10-01"),(283, "1000-10-02"),(284, "1000-10-09"),(285, "1000-10-10"),(286, "1000-10-11"),(287, "1000-10-28"),(288, "1000-11-01"),(289, "1000-11-02"),(290, "1000-11-09"),(291, "1000-11-10"),(292, "1000-11-11"),(293, "1000-11-28"),(294, "1000-12-01"),(295, "1000-12-02"),(296, "1000-12-09"),(297, "1000-12-10"),(298, "1000-12-11"),(299, "1000-12-28"),
      (300, "1001-01-01"),(301, "1001-01-02"),(302, "1001-01-09"),(303, "1001-01-10"),(304, "1001-01-11"),(305, "1001-01-28"),(306, "1001-09-01"),(307, "1001-09-02"),(308, "1001-09-09"),(309, "1001-09-10"),(310, "1001-09-11"),(311, "1001-09-28"),(312, "1001-10-01"),(313, "1001-10-02"),(314, "1001-10-09"),(315, "1001-10-10"),(316, "1001-10-11"),(317, "1001-10-28"),(318, "1001-11-01"),(319, "1001-11-02"),
      (320, "1001-11-09"),(321, "1001-11-10"),(322, "1001-11-11"),(323, "1001-11-28"),(324, "1001-12-01"),(325, "1001-12-02"),(326, "1001-12-09"),(327, "1001-12-10"),(328, "1001-12-11"),(329, "1001-12-28"),(330, "1999-01-01"),(331, "1999-01-02"),(332, "1999-01-09"),(333, "1999-01-10"),(334, "1999-01-11"),(335, "1999-01-28"),(336, "1999-09-01"),(337, "1999-09-02"),(338, "1999-09-09"),(339, "1999-09-10"),
      (340, "1999-09-11"),(341, "1999-09-28"),(342, "1999-10-01"),(343, "1999-10-02"),(344, "1999-10-09"),(345, "1999-10-10"),(346, "1999-10-11"),(347, "1999-10-28"),(348, "1999-11-01"),(349, "1999-11-02"),(350, "1999-11-09"),(351, "1999-11-10"),(352, "1999-11-11"),(353, "1999-11-28"),(354, "1999-12-01"),(355, "1999-12-02"),(356, "1999-12-09"),(357, "1999-12-10"),(358, "1999-12-11"),(359, "1999-12-28"),
      (360, "2000-01-01"),(361, "2000-01-02"),(362, "2000-01-09"),(363, "2000-01-10"),(364, "2000-01-11"),(365, "2000-01-28"),(366, "2000-09-01"),(367, "2000-09-02"),(368, "2000-09-09"),(369, "2000-09-10"),(370, "2000-09-11"),(371, "2000-09-28"),(372, "2000-10-01"),(373, "2000-10-02"),(374, "2000-10-09"),(375, "2000-10-10"),(376, "2000-10-11"),(377, "2000-10-28"),(378, "2000-11-01"),(379, "2000-11-02"),
      (380, "2000-11-09"),(381, "2000-11-10"),(382, "2000-11-11"),(383, "2000-11-28"),(384, "2000-12-01"),(385, "2000-12-02"),(386, "2000-12-09"),(387, "2000-12-10"),(388, "2000-12-11"),(389, "2000-12-28"),(390, "2024-01-01"),(391, "2024-01-02"),(392, "2024-01-09"),(393, "2024-01-10"),(394, "2024-01-11"),(395, "2024-01-28"),(396, "2024-09-01"),(397, "2024-09-02"),(398, "2024-09-09"),(399, "2024-09-10"),
      (400, "2024-09-11"),(401, "2024-09-28"),(402, "2024-10-01"),(403, "2024-10-02"),(404, "2024-10-09"),(405, "2024-10-10"),(406, "2024-10-11"),(407, "2024-10-28"),(408, "2024-11-01"),(409, "2024-11-02"),(410, "2024-11-09"),(411, "2024-11-10"),(412, "2024-11-11"),(413, "2024-11-28"),(414, "2024-12-01"),(415, "2024-12-02"),(416, "2024-12-09"),(417, "2024-12-10"),(418, "2024-12-11"),(419, "2024-12-28"),
      (420, "2025-01-01"),(421, "2025-01-02"),(422, "2025-01-09"),(423, "2025-01-10"),(424, "2025-01-11"),(425, "2025-01-28"),(426, "2025-09-01"),(427, "2025-09-02"),(428, "2025-09-09"),(429, "2025-09-10"),(430, "2025-09-11"),(431, "2025-09-28"),(432, "2025-10-01"),(433, "2025-10-02"),(434, "2025-10-09"),(435, "2025-10-10"),(436, "2025-10-11"),(437, "2025-10-28"),(438, "2025-11-01"),(439, "2025-11-02"),
      (440, "2025-11-09"),(441, "2025-11-10"),(442, "2025-11-11"),(443, "2025-11-28"),(444, "2025-12-01"),(445, "2025-12-02"),(446, "2025-12-09"),(447, "2025-12-10"),(448, "2025-12-11"),(449, "2025-12-28"),(450, "9999-01-01"),(451, "9999-01-02"),(452, "9999-01-09"),(453, "9999-01-10"),(454, "9999-01-11"),(455, "9999-01-28"),(456, "9999-09-01"),(457, "9999-09-02"),(458, "9999-09-09"),(459, "9999-09-10"),
      (460, "9999-09-11"),(461, "9999-09-28"),(462, "9999-10-01"),(463, "9999-10-02"),(464, "9999-10-09"),(465, "9999-10-10"),(466, "9999-10-11"),(467, "9999-10-28"),(468, "9999-11-01"),(469, "9999-11-02"),(470, "9999-11-09"),(471, "9999-11-10"),(472, "9999-11-11"),(473, "9999-11-28"),(474, "9999-12-01"),(475, "9999-12-02"),(476, "9999-12-09"),(477, "9999-12-10"),(478, "9999-12-11"),(479, "9999-12-28");
    """

    sql "set enable_strict_cast=true;"

    test {
        sql """select f1, cast(f2 as float) from test_cast_to_float_from_datev2_0_not_nullable order by 1;"""
        exception ""
    }
    sql "set enable_strict_cast=false;"
    qt_sql_0_non_strict 'select f1, cast(f2 as float) from test_cast_to_float_from_datev2_0_not_nullable order by 1;'

}